import api from './axios.js'

export const elderApi = {
    // 分页获取老人（支持筛选caregiverId/familyId）
    getElders: (params) => api.get('/admin/elder/page', { params }),
    // 根据ID获取老人详情
    getElderById: (elderId) => api.get(`/api/elder/${elderId}`),
    // 获取老人最新健康记录
    getLatestMedical: (elderId) => api.get(`/api/elder/${elderId}/medical/latest`),
    // 获取老人今日餐饮
    getTodayMeals: (elderId) => api.get(`/api/elder/${elderId}/meals/today`),
    // 获取老人今日用药
    getTodayMedicines: (elderId) => api.get(`/api/elder/${elderId}/medicines/today`),
    // 获取老人近期活动
    getRecentActivities: (elderId) => api.get(`/api/elder/${elderId}/activities/recent`),
    // 新增/编辑/修改状态接口不变
    addElder: (data) => api.post('/admin/elder/save', data),
    updateElder: (data) => api.post('/admin/elder/save', data),
    updateElderStatus: (elderId, status) => api.put(`/api/elder/${elderId}/status`, null, { params: { status } })
}